home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / c_lang / strpp31.zip / STR.HIS < prev   
Text File  |  1994-04-18  |  12KB  |  346 lines

  1.  
  2.                        String++ Revision History
  3.  
  4. -----------------------------------------------------------------------
  5.  
  6. Version 3.1
  7. -----------
  8. Bug Fixes:
  9.  
  10. - In some cases the FindNext() function could have a starting position
  11.   beyond the end of the String. This has been fixed.
  12.  
  13. - Split() would incorrectly return a String array of size 1 for a NULL
  14.   argument. It now returns 0.
  15.  
  16. - Bug in SetStr(String&, int, int) fixed.
  17.  
  18. New Features:
  19.  
  20. - Case-sensitivity is supported in comparison operators. Set the com-
  21.   parisons to case-insensitive by first calling SetCaseSensitivity(0),
  22.   or to case-sensitive by calling SetCaseSensitivity(1). This function
  23.   sets an internal function pointer to stricmp() or strcmp(), respec-
  24.   tively. You can also use a custom comparison function by calling
  25.   SetCompare(fname) where fname has the form int fname(char*, char*).
  26.   The default comparison function is strcmp().
  27.  
  28. - toUpper() and toLower() now use static pointers to their respective
  29.   functions. You can set these pointers to user-defined case-conversion
  30.   functions, such as to support diacritic characters, by calling
  31.   SetToLower(fname) or SetToUpper(fname) where fname has the form
  32.   int fname(int). The default functions are tolower() and toupper().
  33.  
  34. - Added unsigned int & unsigned long constructors and Value functions.
  35.  
  36. - New functions:
  37.  
  38.   SetCaseSensitivity()
  39.   SetCompare()
  40.   SetToLower()
  41.   SetToUpper()
  42.  
  43. Other Changes:
  44.  
  45. - The String class has been renamed to StrPP and typedefs are provided
  46.   to use either String or string. This makes compatibility with BC++
  47.   3.x and 4.x easier, and also allows you to use StrPP as a base class
  48.   for your own custom string class and still name it String or string.
  49.  
  50. - Modifications have been made for BC++ 4.0 compatibility. Most nota-
  51.   ble is the fact that you can no longer use a quoted string for a
  52.   regular expression argument. Where this used to work:
  53.  
  54.     sub("/^.*=/", "", arg);
  55.  
  56.   you must now say
  57.  
  58.     sub(Regexp("/^.*=/"), "", arg);
  59.  
  60.   or
  61.     Regexp re1 = "/^.*=/";
  62.     sub(re1, "", arg);
  63.  
  64. - This version has excluded the str.lib file which was for the large
  65.   memory model only. You will need to compile the cpp files for what-
  66.   ever model you want to use and include it in your project list.
  67.   Replacement files for BC++ 3.x's String class have also been exclu-
  68.   ded. Unless there is significant demand for these they will be
  69.   dropped completely.
  70.  
  71. - SetMinLength(), SetIncLength(), and SetFloatFormat() are now static
  72.   functions so you can call them without a String object.
  73.  
  74. - The global mode variables used in Trim() & Justify() are now static
  75.   members of the String class. Therefore, this:
  76.  
  77.     s1.Justify(LEFT, 80, CLIP);
  78.  
  79.   needs to be changed to:
  80.  
  81.     s1.Justify(String::LEFT, 80, String::CLIP);
  82.  
  83. - The C-style functions right(), left(), mid(), justify(), & trim()
  84.   now accept char* instead of String& which should prevent temporaries
  85.   from being created.
  86.  
  87. - Most functions are now virtual so they can be redefined in derived
  88.   classes.
  89.  
  90. -----------------------------------------------------------------------
  91.  
  92. Version 3.0
  93.  
  94. - Support for Borland's container class library (BCCL). There is a BCCL
  95.   compatible version of String++ in strng.*. You can completely replace
  96.   the String module in the class library and get all the functionality
  97.   of String++. See strng.doc for instructions.
  98.  
  99. - The class has been renamed "String" instead of "string" for compati-
  100.   bility with Borland's container class library. The old class name is
  101.   still supported via a typedef.
  102.  
  103. - Support for regular expressions. There is a new class named RegExp
  104.   that is used to declare a regular expression, and a match() function
  105.   for comparisons. For example, if you want to see if a filename has a
  106.   .BAK extension, you can do this:
  107.  
  108.     String FileName = GetFileName();
  109.     Regexp expr = "\.BAK$";
  110.  
  111.     if(match(FileName, expr) != -1)
  112.       do_something();
  113.  
  114.   You could also use the == operator, which is a substitute for the ~
  115.   operator used in AWK:
  116.  
  117.     if(FileName == expr)
  118.       do_something();
  119.  
  120.   A number of string functions have been overloaded to accept regular
  121.   expressions. Like the other AWK functions included with String++, the
  122.   match function returns the substring's position using C's 0-based
  123.   array position instead of AWK's 1-based array position. Therefore, a
  124.   return value of -1 is used to signify no match. For more information
  125.   regarding regular expressions, consult a book on Unix or AWK (such as
  126.   _The AWK Programming Language_ by Aho, Weinberger, and Kernighan).
  127.  
  128. - There are two other new classes included with String++: FileString
  129.   and ParseString. FileString takes a string that represents a file
  130.   name and decomposes it into separate strings for drive, path, file
  131.   name, and file extension. ParseString is a String-derived class that
  132.   adds functions and operators that are useful in parsing functions.
  133.   The RegExp class uses the ParseString class.
  134.  
  135. - Create strings from floating point numbers. Such strings are format-
  136.   ted using a format specifier as described in printf(). The format
  137.   string can be set by the SetFloatFormat() function or passed in the
  138.   constructor.
  139.  
  140. - The Replace function can be used to replace a substring based on its
  141.   position in the string or based on its contents:
  142.  
  143.       String s1 = "This is an old substring";
  144.     s1.Replace(8, 16, "something else");
  145.   or
  146.     s1.Replace("an old substring", "something else");
  147.  
  148. - Four new Find... functions allow greater flexibilty in locating sub-
  149.   strings.
  150.  
  151. - A cast operator for char will return s[0].
  152.  
  153. - A * operator will also return s[0] (such as char ch = *s1).
  154.  
  155. - The inserter operator << can be used to chain appendages:
  156.  
  157.     s1 << "The value of " << x.Name << " is " << x.Value;
  158.  
  159. - The Justify() function now allows the user to disable trimming a
  160.   string to be justified:
  161.  
  162.     s.Justify(CENTER, 80, CLIP|NOTRIM);
  163.  
  164.   The default is CLIP|TRIM as before.
  165.  
  166. - The Delete function now has a default count value of 1, so that
  167.   s1.Delete(10) will delete only the character at s1[10]. If you want
  168.   to delete from pos to the end-of-string, set count = 0 such as
  169.   s1.Delete(10, 0).
  170.  
  171. - Internal changes have resulted in faster code.
  172.  
  173. - The length of the string is now a data member.
  174.  
  175. - Memory allocation is now controlled by two internal integers: strMin-
  176.   Length and strIncLength. strMinLength determines the minimum amount
  177.   of memory that is allocated for a string, and strIncLength specifies
  178.   the incremental amount of memory that a string will grow by. The
  179.   default values are 16 and 8, respectively. The amount of memory a
  180.   string has allocated is stored in bufferLen (bufferLen actually is
  181.   one byte larger for the NULL termination). Here are some examples:
  182.  
  183.     string s1 = "Hello World";        // s1.bufferLen = 17
  184.     string s1 += ",how are you";        // s1.bufferLen = 25
  185.     string s2 = "String++ Version 3.0"    // s2.bufferLen = 25
  186.  
  187.   The tradeoff here is size for speed. On average each string will
  188.   waste either strMinLength/2 bytes or strIncLength/2 bytes. However,
  189.   if you are doing a lot of manipulation, the extra space will speed up
  190.   string operations since less memory allocation is done. You can set
  191.   these variables by calling the appropriate functions:
  192.  
  193.   SetMinLength(unsigned length)
  194.   SetIncLength(unsigned length)
  195.  
  196.   If you set them both to 1 then the string class will behave like
  197.   Version 2.12 and prior. Remember that setting these variables will
  198.   affect all strings.
  199.  
  200. - Support for obsolete naming conventions (from Version 1.x) has been
  201.   removed.
  202.  
  203. - New functions:
  204.  
  205.   FindFirst()        Find first occurance of a substring
  206.   FindNext()        Find next occurance of a substring
  207.   FindLast()        Find last occurance of a substring
  208.   FindPrev()        Find previous occurance of a substring
  209.   match()        Regular expression matching
  210.   Minimize()        Minimize bufferLen
  211.   Replace()        Replace a substring of s with another string
  212.   SetFloatFormat()      Set the floating point format specifier
  213.   SetIncLength()    Set the minimum incremental length
  214.   SetMinLength()    Set the minimum initial length
  215.   SetSize()        Set bufferLen to a particular size
  216.   operator char        Returns s[0]
  217.   operator *        Returns s[0]
  218.   operator <<        Chains appendages
  219.  
  220. -----------------------------------------------------------------------
  221.  
  222. Version 2.12
  223.  
  224. - Fixed bug in the Copy() function. Copy() will allocate memory for the
  225.   char* and therefore should be passed an uninitialized pointer:
  226.  
  227.   char *p;
  228.   s1.Copy(p);    // allocates memory for p & copies s1 to it
  229.  
  230. - split() is now called with just the array name instead of an address
  231.   to the array:
  232.  
  233.   string *array;
  234.   n = split(str1, &array, " ");        // Old way
  235.   n = split(str1, array, " ");        // New way
  236.  
  237.   Memory for array is still allocated within the split function.
  238.  
  239. - A cast operator has been added. This allows a string instance to be
  240.   passed where a char* is expected. Previously, you had to use the ()
  241.   operator or the ptr() function to return the char* contents of a
  242.   string:
  243.  
  244.   string s = "Hello";
  245.   char p[6];
  246.  
  247.   strcpy(p,s());    // old way
  248.   strcpy(p, s);        // new way
  249.  
  250.   The cast operator returns a const char* just like the () operator.
  251.  
  252. -----------------------------------------------------------------------
  253.  
  254. Version 2.11
  255.  
  256. - Fixed bug in int constructor.
  257.  
  258. -----------------------------------------------------------------------
  259.  
  260. Version 2.10
  261.  
  262. - Derived class String from class string for those who prefer the capi-
  263.   talized spelling.
  264.  
  265. - Minor documentation changes
  266.  
  267. -----------------------------------------------------------------------
  268.  
  269. Version 2.01
  270.  
  271. - Minor bug fixes
  272.  
  273. -----------------------------------------------------------------------
  274.  
  275. Version 2.0
  276.  
  277. - Added iostream support.
  278.  
  279. - Enhanced [] operator can now assign individual characters.
  280.  
  281. - Comparison functions are now implemented as inline.
  282.  
  283. - New general functions:
  284.  
  285.   Insert()    inserts text in str
  286.   Delete()      deletes a substring of str
  287.   Copy()        copies str to a non-const char*
  288.   Trim()    trims leading or trailing multiple chars from str.
  289.   Value()       returns the numeric value (int or long) of str.
  290.  
  291. - Existing methods have been renamed to begin with an uppercase letter,
  292.   such as string::justify() -> string::Justify(). The older naming con-
  293.   ventions are still supported for backwards compatibility. Most member
  294.   methods now operate directly on the string itself instead of returning
  295.   a new string. For example, str1.Justify() will modify str1 instead of
  296.   creating a new string. C-style function names remain all lower-case
  297.   and return newly created strings, so str2 = justify(str1, LEFT, 80)
  298.   will not modify str1.
  299.  
  300. - AWK functions are also implemented as member methods that directly
  301.   modify the string object. These versions begin with an uppercase.
  302.  
  303. - Constructors and = operators added for int & long data types. New
  304.   function Value() returns the numeric value of a string.
  305.  
  306. - The () operator continues to return a const char* to the string
  307.   object's data, but the ptr() method now returns a non-const char*.
  308.   Therefore, if you need to pass a string's contents to a C-style func-
  309.   tion that wants a non-const char*, use ptr():
  310.  
  311.   Old way:
  312.  
  313.         strupr((char *)s1());    // strupr() wants to modify s1 directly
  314.                                 //   so s1 must be cast as non-const
  315.   New way:
  316.  
  317.       strupr(s1.ptr());       // s1.ptr() is now non-const
  318.  
  319.   Returning a non-const char* completely strips the inherent protection
  320.   that the string class offers and can be very dangerous. Use this with
  321.   caution.
  322.  
  323. -----------------------------------------------------------------------
  324.  
  325. Version 1.1
  326.  
  327. - Bug fixes, mostly memory leaks.
  328.  
  329. - Rewrote several functions for improved efficiency.
  330.  
  331. - Improved demo program.
  332.  
  333. - gsub() is generalized with the inclusion of a num parameter.
  334.  
  335. - New justify() function.
  336.  
  337. - New operators * and *=.
  338.  
  339. -----------------------------------------------------------------------
  340.  
  341. Version 1.0
  342.  
  343. - Initial release.
  344.  
  345. -----------------------------------------------------------------------
  346.